// 商品品牌相关的请求  API
// 品牌管理
import http from "./request";
// 根据品牌名称分页获取品牌列表   // brand/list
const getBrandList = (params: IBrandListParams): PRES<IBrandListModel> =>
  http.get("brand/list", { params });

// 表格数据 /brand/list
const brandList = (params: any): PRES<IbrandList> =>
  http.get(`/brand/list/`, { params });

// `/brand/list/?keyword=${params.keyword}&pageNum=${params.pageNum}&pageSize=${params.pageSize}`;
// 编辑的请求 /mall-admin/brand/
const mallBrand = (id: number) => http.get(`/brand/${id}`);

// 上传提交
const brandCreate = (params: any) => http.post("/brand/create/", params);

// 修改品牌内容/brand/update/{id}
const brandUpdate = (id: number, params: any) =>
  http.post(`/brand/update/${id}`, params);

// 上传新照片
const minioUpload = (params: any): PRES<IbigURl> =>
  http.post(`/minio/upload`, params);

// 删除的请求
const brandDelete = (id: number) => http.get(`/brand/delete/${id}`);
export {
  brandList,
  mallBrand,
  brandCreate,
  brandUpdate,
  minioUpload,
  getBrandList,
  brandDelete,
};
